package com.orangelife.mobile.confirmOrder.biz;

import android.os.Handler;

import com.curry.android.http.HttpUtil;
import com.orangelife.mobile.common.biz.JSONRequest;
import com.orangelife.mobile.constants.Constant;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by orangelife on 16/11/14.
 */
public class GoodsHttpBiz {

    /** URL-选中商品的列表 */
    public static final String URL_SELECTED_MERCHANT_GOOD_LIST = Constant.URL_SELECTED_MERCHANT_GOOD_LIST;

    /**
     * 根据产品ID列表来获取已选中的（商户-商品）列表
     *
     * @param listProducts 产品列表
     * @param handler
     * @param what
     */
    public static void getSelectedMerchantGoodList(ArrayList<String> listProducts, Handler handler, int what) {
        Map<String, Object> mapProductIDs = new HashMap<>();
        mapProductIDs.put("productIDs", listProducts);
        JSONRequest.getInstance().sendRequest(JSONRequest.PUT, URL_SELECTED_MERCHANT_GOOD_LIST, mapProductIDs, handler, what, HttpUtil.ACTION_JSON);
    }
}
